package day01;

/**
 * @author Jetwang
 * @version 1.0
 * @since 2023/2/28 9:46
 * 求1-n的阶累加
 */
public class SingleRecursion02 {

    public static void main(String[] args) {
        int res = added(100);
        System.out.println("1-100累加 = " + res);
    }

    public static int added(int n) {
        if (n == 1) {
            return 1;
        }
        return n + added(n-1);
    }
}
